{% extends 'df_goods/base.html' %}

{% block detail2 %}

    <div class="r_wrap fr clearfix">
        <div class="sort_bar">
            <a href="/list{{ typeinfo.id }}_1_1/"
               {% if sort == '1' %}
                   class="active"
               {% endif %}
                >默认</a>
            <a href="/list{{ typeinfo.id }}_1_2/"
               {% if sort == '2' %}
                   class="active"
               {% endif %}
                >价格</a>
            <a href="/list{{ typeinfo.id }}_1_3/"
               {% if sort == '3' %}
                   class="active"
               {% endif %}
                >人气</a>

        </div>

        <ul class="goods_type_list clearfix">
            {% for g in page %}
            <li>
                <a href="/{{ g.id }}/"><img src="/static/{{ g.gpic }}"></a>
                <h4><a href="/{{ g.id }}/">{{ g.gtitle }}</a></h4>
                <div class="operate">
                    <span class="prize">￥{{ g.gprice }}</span>
                    <span class="unit">{{ g.gprice }}/{{ g.gunit }}</span>
                    <a href="/cart/add{{ g.id }}_1/" class="add_goods" title="加入购物车"></a>
                </div>
            </li>
            {% endfor %}


            <li>
                <a href="#"><img src="/static/images/goods/goods009.jpg"></a>
                <h4><a href="#">海南香蕉</a></h4>
                <div class="operate">
                    <span class="prize">￥3.30</span>
                    <span class="unit">3.30/500g</span>
                    <a href="#" class="add_goods" title="加入购物车"></a>
                </div>
            </li>

            <li>
                <a href="#"><img src="/static/images/goods/goods010.jpg"></a>
                <h4><a href="#">青苹果</a></h4>
                <div class="operate">
                    <span class="prize">￥5.00</span>
                    <span class="unit">5.00/500g</span>
                    <a href="#" class="add_goods" title="加入购物车"></a>
                </div>
            </li>

            <li>
                <a href="#"><img src="/static/images/goods/goods011.jpg"></a>
                <h4><a href="#">山莓</a></h4>
                <div class="operate">
                    <span class="prize">￥28.80</span>
                    <span class="unit">28.8/500g</span>
                    <a href="#" class="add_goods" title="加入购物车"></a>
                </div>
            </li>

            <li>
                <a href="#"><img src="/static/images/goods/goods012.jpg"></a>
                <h4><a href="#">奇异果</a></h4>
                <div class="operate">
                    <span class="prize">￥25.80</span>
                    <span class="unit">25.8/500g</span>
                    <a href="#" class="add_goods" title="加入购物车"></a>
                </div>
            </li>
            <li>
                <a href="#"><img src="/static/images/goods/goods013.jpg"></a>
                <h4><a href="#">蜜桔</a></h4>
                <div class="operate">
                    <span class="prize">￥4.80</span>
                    <span class="unit">4.8/500g</span>
                    <a href="#" class="add_goods" title="加入购物车"></a>
                </div>
            </li>
            <li>
                <a href="#"><img src="/static/images/goods/goods014.jpg"></a>
                <h4><a href="#">脐橙</a></h4>
                <div class="operate">
                    <span class="prize">￥3.50</span>
                    <span class="unit">3.50/500g</span>
                    <a href="#" class="add_goods" title="加入购物车"></a>
                </div>
            </li>
            <li>
                <a href="#"><img src="/static/images/goods/goods001.jpg"></a>
                <h4><a href="#">进口柠檬</a></h4>
                <div class="operate">
                    <span class="prize">￥3.90</span>
                    <span class="unit">3.90/500g</span>
                    <a href="#" class="add_goods" title="加入购物车"></a>
                </div>
            </li>
            <li>
                <a href="#"><img src="/static/images/goods/goods002.jpg"></a>
                <h4><a href="#">玫瑰香葡萄</a></h4>
                <div class="operate">
                    <span class="prize">￥16.80</span>
                    <span class="unit">16.80/500g</span>
                    <a href="#" class="add_goods" title="加入购物车"></a>
                </div>
            </li>
        </ul>

        <div class="pagenation">
            {% if page.has_previous %}
                <a href="/list{{ typeinfo.id }}_{{ page.previous_page_number }}_{{ sort }}/">上一页</a>
            {% endif %}

            {% for pindex in paginator.page_range %}
                {%  if pindex == page.number %}
                    <a href="/list{{ typeinfo.id }}_{{ pindex }}_{{ sort }}/" class="active">{{ pindex }}</a>
                {% else %}
                <a href="/list{{ typeinfo.id }}_{{ pindex }}_{{ sort }}/">{{ pindex }}</a>
                {% endif %}
            {% endfor %}

            {% if page.has_next %}
                <a href="/list{{ typeinfo.id }}_{{ page.next_page_number }}_{{ sort }}/">下一页</a>
            {% endif %}
        </div>
    </div>

{% endblock detail2 %}